/*
 * LinearInterpolator.h
 *
 *  Created on: 23 Aug 2011
 *      Author: Allan
 */

#ifndef LINEARINTERPOLATOR_H_
#define LINEARINTERPOLATOR_H_

// C++ includes
#include <vector>
using namespace std;

class LinearInterpolator 
{
public:
	LinearInterpolator();
	
	LinearInterpolator(const vector<double>& xi, const vector<double>& yi);
	
	const double
	operator()(double x) const;
	
private:
	/// The interpolation points on the x-axis
	vector<double> xi;
	
	/// The interpolation points on the y-axis
	vector<double> yi;
	
private:
	const unsigned
	FindPosition(double x) const;
};

#endif /* LINEARINTERPOLATOR_H_ */
